package cn.newgrand.netcall.common;

public class StringUtilCommon {
	
	public static String gainRandomNum(){
		StringBuilder builder = new StringBuilder();
		for(int i=0; i<6; i++){
			int num = (int)(Math.random()*10);
			builder.append(num);
		}
		return builder.toString();
	}
	
	public static String parseName(String XMPPAddress) {
        if (XMPPAddress == null) {
            return null;
        }
        int atIndex = XMPPAddress.lastIndexOf("@");
        if (atIndex <= 0) {
            return XMPPAddress;
        }
        else {
            return XMPPAddress.substring(0, atIndex);
        }
    }

}
